// 1.摄氏温度(centigrade) = 5.0 / 9.0 * (华氏溫度(Fahrenheit) - 32.0)
// 2.开氏溫度(Kelvin) = 摄氏溫度 + 273.16
// 3.自定义函数Tempertatures(),接受double类型华氏温度进行转换，返回类型为void。

#include <stdio.h>

void Temperatures(double Fah);

int main(void)
{
    double Fah;

    puts("The program performs temperature conversion.");
    puts("Now enter the Fahrenheit temperature: ");
    while (scanf("%lf", &Fah) == 1)
    {
        Temperatures(Fah);

        puts("Now enter next Fahrenheit temperature (q to quit): ");
    }
    puts("Done");

    return 0;
}

void Temperatures(double fah)
{
    const double cen = 5.0 / 9.0 * (fah - 32);
    const double kel = cen + 273.16;

    printf("Fahrenheit temperature: %.2f\n", fah);
    printf("Centigrade temperature: %.2f\n", cen);
    printf("    Kelvin temperature: %.2f\n", kel);
}
